<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><title>Tp5框架整合phpqrcode二维码 | Ahuang'Blog</title><meta name="author" content="Ahuang"><meta name="copyright" content="Ahuang"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="前段时间写了一个App接口的项目，用到了二维码。在网上查了查资料，找了个简单的方法，把步骤梳理一下。 安装phpQrcode首先在tp中的composer.json文件中的 require 段加上 1&quot;endroid&#x2F;qrcode&quot;: &quot;1.*@dev  然后用git版本控制器或者cmd命令进入项目目录中，执行composer update命令，将二维码包更新到本地项">
<meta property="og:type" content="article">
<meta property="og:title" content="Tp5框架整合phpqrcode二维码">
<meta property="og:url" content="http://huangxiaochang.gitee.io/ahuang_blog/2017/12/07/001/index.html">
<meta property="og:site_name" content="Ahuang&#39;Blog">
<meta property="og:description" content="前段时间写了一个App接口的项目，用到了二维码。在网上查了查资料，找了个简单的方法，把步骤梳理一下。 安装phpQrcode首先在tp中的composer.json文件中的 require 段加上 1&quot;endroid&#x2F;qrcode&quot;: &quot;1.*@dev  然后用git版本控制器或者cmd命令进入项目目录中，执行composer update命令，将二维码包更新到本地项">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png">
<meta property="article:published_time" content="2017-12-06T17:05:13.000Z">
<meta property="article:modified_time" content="2023-01-31T12:21:34.724Z">
<meta property="article:author" content="Ahuang">
<meta property="article:tag" content="phpQrcode">
<meta property="article:tag" content="Tp5">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png"><link rel="shortcut icon" href="/ahuang_blog/img/favicon.ico"><link rel="canonical" href="http://huangxiaochang.gitee.io/ahuang_blog/2017/12/07/001/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta/><link rel="stylesheet" href="/ahuang_blog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/ahuang_blog/',
  algolia: undefined,
  localSearch: {"path":"/ahuang_blog/search.xml","preload":true,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: {"limitDay":500,"position":"top","messagePrev":"It has been","messageNext":"days since the last update, the content of the article may be outdated."},
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":400},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: true,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Tp5框架整合phpqrcode二维码',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-01-31 20:21:34'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = url => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      link.onload = () => resolve()
      link.onerror = () => reject()
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/blog/css/transpancy.css"><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/js-heo@1.0.11/mainColor/heoMainColor.css"><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/js-heo@1.0.11/categoryBar/categoryBar.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-clock/lib/clock.min.css" /><!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>const preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',()=> { preloader.endLoading() })

if (false) {
  document.addEventListener('pjax:send', () => { preloader.initLoading() })
  document.addEventListener('pjax:complete', () => { preloader.endLoading() })
}</script><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/ahuang_blog/img/Misaka.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/ahuang_blog/archives/"><div class="headline">文章</div><div class="length-num">51</div></a><a href="/ahuang_blog/tags/"><div class="headline">标签</div><div class="length-num">35</div></a><a href="/ahuang_blog/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/ahuang_blog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg fixed" id="page-header" style="background-image: url('https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png')"><nav id="nav"><span id="blog-info"><a href="/ahuang_blog/" title="Ahuang'Blog"><span class="site-name">Ahuang'Blog</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/ahuang_blog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Tp5框架整合phpqrcode二维码</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2017-12-06T17:05:13.000Z" title="发表于 2017-12-07 01:05:13">2017-12-07</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-01-31T12:21:34.724Z" title="更新于 2023-01-31 20:21:34">2023-01-31</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/ahuang_blog/categories/PHP/">PHP</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">318</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>1分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Tp5框架整合phpqrcode二维码"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><p>前段时间写了一个App接口的项目，用到了二维码。在网上查了查资料，找了个简单的方法，把步骤梳理一下。</p>
<h2 id="安装phpQrcode"><a href="#安装phpQrcode" class="headerlink" title="安装phpQrcode"></a>安装phpQrcode</h2><p>首先在tp中的composer.json文件中的 require 段加上</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&quot;endroid/qrcode&quot;</span>: <span class="string">&quot;1.*@dev</span></span><br></pre></td></tr></table></figure>

<p>然后用git版本控制器或者cmd命令进入项目目录中，执行composer update命令，将二维码包更新到本地项目中。</p>
<h2 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h2><p>将控制器中添加生成二维码的方法</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">public <span class="keyword">function</span> <span class="function"><span class="title">videoQrcodes</span></span>()</span><br><span class="line">&#123;        </span><br><span class="line">    //生成当前的二维码</span><br><span class="line">    <span class="variable">$qrCode</span> = new \Endroid\QrCode\QrCode();       </span><br><span class="line">    //想显示在二维码中的文字内容，这里设置了一个查看文章的地址</span><br><span class="line">    <span class="variable">$url</span> = <span class="string">&#x27;project.cn/admin/admin/videoCates?id=&#x27;</span>.<span class="variable">$id</span>;   //扫二维码跳转的地址</span><br><span class="line">    <span class="variable">$qrCode</span>-&gt;setText(<span class="variable">$url</span>)</span><br><span class="line">        -&gt;setSize(300)</span><br><span class="line">        -&gt;setPadding(10)</span><br><span class="line">        -&gt;setErrorCorrection(<span class="string">&#x27;high&#x27;</span>)</span><br><span class="line">        -&gt;setForegroundColor(array(<span class="string">&#x27;r&#x27;</span> =&gt; 0, <span class="string">&#x27;g&#x27;</span> =&gt; 0, <span class="string">&#x27;b&#x27;</span> =&gt; 0, <span class="string">&#x27;a&#x27;</span> =&gt; 0))</span><br><span class="line">        -&gt;setBackgroundColor(array(<span class="string">&#x27;r&#x27;</span> =&gt; 255, <span class="string">&#x27;g&#x27;</span> =&gt; 255, <span class="string">&#x27;b&#x27;</span> =&gt; 255, <span class="string">&#x27;a&#x27;</span> =&gt; 0))</span><br><span class="line">        -&gt;setLabel(<span class="string">&#x27;&#x27;</span>)</span><br><span class="line">        -&gt;setLabelFontSize(16)</span><br><span class="line">        -&gt;setImageType(\Endroid\QrCode\QrCode::IMAGE_TYPE_PNG);</span><br><span class="line">     <span class="variable">$qrCode</span>-&gt;render();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>前端的html页面在二维码的位置添加</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;img  src=<span class="string">&quot;&#123;:url(&#x27;admin/admin/videoQrcodes&#x27;)&#125;?id=&#123;<span class="variable">$vo</span>.id&#125;&quot;</span>&gt;</span><br></pre></td></tr></table></figure>
<p>url的值指定后台控制器生成二维码的方法</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="http://huangxiaochang.gitee.io/ahuang_blog">Ahuang</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://huangxiaochang.gitee.io/ahuang_blog/2017/12/07/001/">http://huangxiaochang.gitee.io/ahuang_blog/2017/12/07/001/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://huangxiaochang.gitee.io/ahuang_blog" target="_blank">Ahuang'Blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/ahuang_blog/tags/phpQrcode/">phpQrcode</a><a class="post-meta__tags" href="/ahuang_blog/tags/Tp5/">Tp5</a></div><div class="post_share"></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-full"><a href="/ahuang_blog/2018/03/08/002/" title="Tp5整合融云开发聊天功能"><img class="cover" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="onerror=null;src='/ahuang_blog/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Tp5整合融云开发聊天功能</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/ahuang_blog/2018/03/08/002/" title="Tp5整合融云开发聊天功能"><img class="cover" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2018-03-08</div><div class="title">Tp5整合融云开发聊天功能</div></div></a></div><div><a href="/ahuang_blog/2018/03/09/003/" title="Tp5整合七牛云直播生成推流拉流连接"><img class="cover" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2018-03-09</div><div class="title">Tp5整合七牛云直播生成推流拉流连接</div></div></a></div><div><a href="/ahuang_blog/2018/03/11/005/" title="Tp5整合容联云短信接口"><img class="cover" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2018-03-11</div><div class="title">Tp5整合容联云短信接口</div></div></a></div><div><a href="/ahuang_blog/2018/03/16/004/" title="Web端使用融云web Api写聊天"><img class="cover" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2018-03-16</div><div class="title">Web端使用融云web Api写聊天</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/ahuang_blog/img/Misaka.jpg" onerror="this.onerror=null;this.src='/ahuang_blog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Ahuang</div><div class="author-info__description">Everything can be expected in the future</div></div><div class="card-info-data site-data is-center"><a href="/ahuang_blog/archives/"><div class="headline">文章</div><div class="length-num">51</div></a><a href="/ahuang_blog/tags/"><div class="headline">标签</div><div class="length-num">35</div></a><a href="/ahuang_blog/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/changad" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:136081905@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">快乐每一天！！！</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%89%E8%A3%85phpQrcode"><span class="toc-number">1.</span> <span class="toc-text">安装phpQrcode</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BB%A3%E7%A0%81"><span class="toc-number">2.</span> <span class="toc-text">代码</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2022/04/24/051/" title="项目中一些ThinkPhp的使用小技巧">项目中一些ThinkPhp的使用小技巧</a><time datetime="2022-04-24T10:43:22.000Z" title="发表于 2022-04-24 18:43:22">2022-04-24</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2022/04/08/050/" title="Sql查询排名">Sql查询排名</a><time datetime="2022-04-08T08:24:16.000Z" title="发表于 2022-04-08 16:24:16">2022-04-08</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2022/03/06/049/" title="ThinkPhp的跨域问题">ThinkPhp的跨域问题</a><time datetime="2022-03-06T04:40:38.000Z" title="发表于 2022-03-06 12:40:38">2022-03-06</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2021/11/13/048/" title="Nginx关于Socket的配置">Nginx关于Socket的配置</a><time datetime="2021-11-13T07:02:15.000Z" title="发表于 2021-11-13 15:02:15">2021-11-13</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2021/10/28/047/" title="Node.js之Express关于socket.io的使用">Node.js之Express关于socket.io的使用</a><time datetime="2021-10-28T04:36:17.000Z" title="发表于 2021-10-28 12:36:17">2021-10-28</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2018 - 2023 By Ahuang</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Everything can be expected in the future!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/ahuang_blog/js/utils.js"></script><script src="/ahuang_blog/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="/ahuang_blog/js/search/local-search.js"></script><div class="js-pjax"></div><script src="https://cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script><script async src="https://cdn.jsdelivr.net/npm/js-heo@1.0.11/categoryBar/categoryBar.js"></script><script src="/blog/js/categoryBar.js"><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-fluttering-ribbon.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = true;
POWERMODE.mobile = true;
document.body.addEventListener('input', POWERMODE);
</script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/click-heart.min.js" async="async" mobile="true"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --><script data-pjax>
  function butterfly_clock_injector_config(){
    var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
    var item_html = '<div class="card-widget card-clock"><div class="card-glass"><div class="card-background"><div class="card-content"><div id="hexo_electric_clock"><img class="entered loading" id="card-clock-loading" src="/ahuang_blog/img/loading.gif" style="height: 120px; width: 100%;" data-ll-status="loading"/></div></div></div></div></div>';
    console.log('已挂载butterfly_clock')
    parent_div_git.insertAdjacentHTML("afterbegin",item_html)
    }
  var elist = 'null'.split(',');
  var cpage = location.pathname;
  var epage = 'all';
  var flag = 0;

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    butterfly_clock_injector_config();
  }
  else if (epage === cpage){
    butterfly_clock_injector_config();
  }
  </script><script src="https://pv.sohu.com/cityjson?ie=utf-8"></script><script data-pjax src="https://npm.elemecdn.com/hexo-butterfly-clock/lib/clock.min.js"></script><!-- hexo injector body_end end --></body></html>